import Home from "@/pages/Home";

export default {
    namespaced: true,
    state: {
        isSidebarNavCollapse : false,
        tabsList:[]
    },
    getters: {},
    mutations: {
        toggleNavCollapse(state, routes) {
            state.isSidebarNavCollapse =  !state.isSidebarNavCollapse;
            console.log(state.isSidebarNavCollapse)
        },
        closeTag(state, routes){
            state.tabsList = state.tabsList.filter(item=> item.path !==routes.path)
        },
        addTag(state, routes){

            let haved = state.tabsList.find(item=> item.path ===routes.path)
            if (haved){
                return
            }
            state.tabsList = [...state.tabsList,routes]
            console.log(state.tabsList)
        },
    },
    actions: {

    }
}
